package service

import (
	"shop/src/model"
	"shop/src/repository"
)

func NewOrderService(orderRepository *repository.OrderRepository) *OrderService {
	return &OrderService{repository: orderRepository}
}

type OrderService struct {
	repository *repository.OrderRepository
}

func (s *OrderService) Create(order *model.Order) (int64, error) {
	id, err := s.repository.Create(order)
	if err != nil {
		return 0, err
	}
	return id, nil
}

func (s *OrderService) Delete(id int64) error {
	return s.repository.Delete(id)
}

func (s *OrderService) List(task model.Order, pageNo int, pageSize int) ([]model.Order, error) {
	//TODO implement me
	panic("implement me")
}

func (s *OrderService) Get(id int64) (model.Order, error) {
	//TODO implement me
	panic("implement me")
}
